<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>用户登录 - {$Think.config.SYSTEM_WEBNAME}</title>
	<Pintuer />
	<Layer />
	<link rel="stylesheet" href="{:__CSS__}/default.css">
	<script type="text/javascript" src="{:__JS__}/default.js"></script>
</head>
<body>
	<div class="layout">
		<form id="login-form" class="form-auto">
			<div class="login-register-bg">
				<div class="line">
					<div class="x5">
						<img src="__PUBLIC__/images/logo.png" height="55">
					</div>
					<div class="x7 padding-big-top">
						<span class="text-white">
							源自相同的起点，演绎不同的人生！
						</span>
					</div>
				</div>
			</div>
			<div class="line margin-large-top">
				<div class="x3 text-right padding-small-top">
					手 机：
				</div>
				<div class="x6">
					<input type="text" name="mobile" class="input radius-none">
				</div>
				<div class="x3"></div>
			</div>
			<div class="line margin-top">
				<div class="x3 text-right padding-small-top">
					密 码：
				</div>
				<div class="x6">
					<input type="password" name="user_pass" class="input radius-none">
				</div>
				<div class="x3"></div>
			</div>
			<div class="line margin-top">
				<div class="x3">
				</div>
				<div class="x6">
					<button type="submit" class="button bg-green radius-none">
						立即登录
					</button>
					<button type="button" onclick="GetUrl('{:U('Home/Public/register')}');" class="button radius-none bg-blue">
						立即注册
					</button>
				</div>
				<div class="x3"></div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
		$(function(){
			// 当前窗口处理
			var my_this = parent.layer.getFrameIndex(window.name); //获取窗口索引
			parent.$('#layui-layer'+my_this).css({'width' : '430px','height' : '250px'});
			parent.$('#layui-layer-iframe'+my_this).css({'width' : '430px','height' : '250px'});
			// 表单处理
			$('#login-form').submit(function(e){
				e.preventDefault();
				if ($(this).find('input[name=mobile]').val() == '') {
					layer.msg('请输入手机/邮箱');
					$(this).find('input[name=mobile]').focus();
					return false;
				};
				if ($(this).find('input[name=user_pass]').val() == '') {
					layer.msg('请输入登录密码');
					$(this).find('input[name=user_pass]').focus();
					return false;
				};
				var data = $(this).serialize();
				var index = layer.msg('请稍等，正在加载中...',{
					icon : 16,
					time : 30 * 1000,
				});
				$.ajax({
					url : "{:U('Public/login')}",
					data : data,
					dataType : 'json',
					type : 'post',
					success : function(ret,err){
						layer.close(index);
						if (ret.status == 1) {
							layer.msg(ret.info,function(){
								parent.window.location.reload();
								parent.layer.close(index);
							});
						}else{
							layer.msg(ret.info);
						};
					}
				});
			});
		});
	</script>
</body>
</html>